#include "mystdio.h"
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "mymath.h"
//#include <mymath.h>//使用-I表明头文件所在路径就可以头文件带<>

int main()
{
    MYFILE* fp = my_fopen("log.txt", "w");
    if(!fp)
    {
        return 1;
    }

    char data[SIZE];
    const char* str = "hello mystdio";
    int cnt = 10;
    while(cnt--)
    {
        snprintf(data, sizeof(data), "%s: %d", str, cnt);
        my_fwrite(data, strlen(data), fp);
        //sleep(1);
    }
    my_fclose(fp);

    printf("1+2=%d\n", Add(1, 2));


    return 0;
}
